cd  "E:\Replication Data for Media Freedom and Public Trust in Science" 

use Data_Gu_Main, clear

**# 前期准备
***生成控制变量的宏
*个人层面 ： female  emp  income 
global cov ( i.female i.emp i.income )
*国家层面 ： loggdppc logpop  log_nobel_pc log_qs500_pc 
global agg ( c.loggdppc c.logpop c.log_nobel_pc c.log_qs500_pc c.e_pelifeex )

***画图设置
set scheme s2color
grstyle init
grstyle color background white
grstyle set plain,horizontal grid
grstyle set color Set1
grstyle color ci_area gs12%40

**#FIGURE A.4: An Illustration of Continuous Media Freedom (V-Dem)
*[F]DATA_cohort_mediafreedom(V-Dem).dta

**#FIGURE A.6: Estimation Results for Individual Questions from WGM 2020
global science_all ///
trust_scientist trust_science trust_doctors trust_scientistinfo scientist_benifitpublic scientist_workbenifit scientist_workbenifityou tech_increasejob science_impactonhealth science_impactonenvironment trust_explainbody trust_explainfeelings religious_vs_science
	
foreach i in $science_all{
local var Mexp_conVDem_14after
qui reghdfe `i'    ///
c.`var'##i.edu  $agg##i.edu $cov##c.`var'   ,a(country birthyear) cluster(country ) 
expint `i' `var' beta
expmat ".\result_indiQ\cs_`i'"

local var Mexp_binVDem_14after
qui reghdfe `i'     ///
c.`var'##i.edu   $agg##i.edu $cov##c.`var'  ,a(country i.birthyear) cluster(country)  keepsing
expint `i'  `var'  beta
expmat ".\result_indiQ\ch_`i'"
}





